<?php
require_once 'Common.php';
class BdApi extends Common
{
    /*
        添加店铺
        params
           store_id 门店ID 
           store_name 门店名称
           start_time 营业开始时间
           end_time 营业结束时间
    */
    public function addStoreInfo($store_id = 0, $store_name = '', $start_time = '', $end_time = '')
    {
        $action = array();
        $action['m'] = "BdApi";
        $action['a'] = "addStoreInfo";


        $data = array();
        $data['store_id'] = $store_id; //门店ID
        $data['store_name'] = $store_name; //门店名称
        $data['start_time'] = $start_time; //营业开始时间
        $data['end_time'] = $end_time; //营业结束时间

        return $this->reqSvc($action, $data);
    }

    /*
        初始化分类
        params
            store_id 门店ID
    */
    public function initCategoryInfo($store_id = 0)
    {
        $action = array();
        $action['m'] = "BdApi";
        $action['a'] = "initCategoryInfo";
        
        $data = array();
        $data['store_id'] = $store_id; 

        return $this->reqSvc($action, $data);
    }

    /*
        添加自定义分类
        params
            store_id 店铺id
            category_id 分类id
            other_category_name 第三方分类名称
            other_category_rank 第三方分类排序
    */
    public function addCategoryInfo($store_id = 0, $category_id = 0, $other_category_name = '', $other_category_rank = 0)
    {
        $action = array();
        $action['m'] = "BdApi";
        $action['a'] = "addCategoryInfo";

        $data = array();
        $data['store_id'] = $store_id;
        $data['category_id'] = $category_id;
        $data['other_category_name'] = $other_category_name;
        $data['other_category_rank'] = $other_category_rank;


        return $this->reqSvc($action, $data);
    }

    /*
        删除第三方分类
        params
            store_id 店铺id
            other_category_id 第三方分类id
    */
    public function delCategoryInfo($store_id = 0, $other_category_id = '')
    {
        $action = array();
        $action['m'] = "BdApi";
        $action['a'] = "delCategoryInfo";

        $data = array();
        $data['store_id'] = $store_id;
        $data['other_category_id'] = $other_category_id;


        return $this->reqSvc($action, $data);
    }

    /*
        更新第三方分类
        params
            store_id 店铺id
            other_category_id 第三方分类id
            other_category_name 第三方分类名称
            other_category_rank 第三方分类排序
    */
    public function updateCategoryInfo($store_id = 0, $other_category_id = 0, $other_category_name = '', $other_category_rank = 0)
    {
        $action = array();
        $action['m'] = "BdApi";
        $action['a'] = "updateCategoryInfo";

        $data = array();
        $data['store_id'] = $store_id;
        $data['other_category_id'] = $other_category_id;
        $data['other_category_name'] = $other_category_name;
        $data['other_category_rank'] = $other_category_rank;



        return $this->reqSvc($action, $data);
    }
}
?>